/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package character_3;

/**
 *
 * @author Administrator
 */
public class Character_3 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        
        //byte,short,int,long范围
        System.out.printf("%d -- %d%n", Byte.MIN_VALUE, Byte.MAX_VALUE);
        System.out.printf("%d -- %d%n", Short.MIN_VALUE, Short.MAX_VALUE);
        System.out.printf("%d -- %d%n", Integer.MIN_VALUE, Integer.MAX_VALUE);
        System.out.printf("%d -- %d%n", Long.MIN_VALUE, Long.MAX_VALUE);
        
        //float,double精度范围
        System.out.printf("%d -- %d%n", Float.MIN_EXPONENT, Float.MAX_EXPONENT);
        System.out.printf("%d -- %d%n", Double.MIN_EXPONENT, Double.MAX_EXPONENT);
        
        //char可表示的Unicode范围
        System.out.printf("%h -- %h%n", Character.MIN_VALUE, Character.MAX_VALUE);
        
        //boolean的两个值
        System.out.printf("%b -- %b%n", Boolean.TRUE, Boolean.FALSE);
        
        int num = 014;
        System.out.printf("%d \n", num);
        System.out.printf("%x \n", num);
        System.out.printf("%o \n", num);
        
        int num1 = 12;  
	int num2 = 0xc;  
	int num3 = 014;
        System.out.println(num1);
        System.out.println(num2);
        System.out.println(num3);  
        
        int num4 = 1234_5678;
        double num5 = 3.1415_9265;
        System.out.println(num4);
        System.out.println(num5);
        
        int num6 = 0b101010101010;
        int num7 = 0b1010_1010_1010;
        System.out.println(num6);
        System.out.println(num7);
        
        System.out.printf("10 >= 5 结果 %b%n", 10>=5);
        System.out.printf("10 <= 5 结果 %b%n", 10<=5);
        System.out.printf("10 != 5 结果 %b%n", 10!=5);
        
        int score = 59;
        System.out.printf("该学生是否及格？ %c%n", score >= 60 ? '是':'否');
        
//        String s = "haha", b = "ahah";
//        System.out.print(s.equals(b));
        
        int a = 0b11010011;
        int b = 0b00110111;
        System.out.println(Integer.toBinaryString(a>>>2));
        System.out.println(Integer.toBinaryString(b>>>2));
        
        int i = 0, j = 0;
        i = j++;
        System.out.println(i);
        System.out.println(j);
        
        float f1 = 3.14f, f2 = (float) 3.14;
        System.out.println(f1);
        System.out.println(f2);
        
        long c = 21_4748_3648L;
        System.out.println(c);
        
        short e = 1, g = 2;
        short h = (short) (g + e);
        
        int k = 21_4748_3647;
        System.out.println(k + 1);
        
        while(true) {
            int number = (int) (Math.random() * 10);
            System.out.println(number);
            if(number == 5) {
                System.out.println("I hit 5 ...Orz");
                break;
            }
        }
        int number;
        do {
            number = (int) (Math.random() * 10);
            System.out.println(number);
        }while(number != 5);
        System.out.println("I hit 5 ...Orz");
        
        for(int y = 1; y <= 10; y++) {
            if(y == 5) {
                break;
            }
            System.out.println(y);
        }
        System.out.println("=========================================");
        for(int y = 1; y <= 10; y++) {
            if(y == 5) {
                continue;
            }
            System.out.println(y);
        }
        System.out.println("=========================================");
        
        back : {
            for(int y = 1; y <= 10; y++) {
                if(y == 9) {
                    System.out.println("break");
                    break back;
                }
            } 
            System.out.println("test");
        }
        System.out.println("=========================================");
        back1 : for(int x = 0; x < 10; x++) {
            back2 : 
            for(int z = 0; z < 10; z++) {
                if (z == 9) {
                    continue back2;
                }
            }
            System.out.println("test");
        }
    }
   
}
